﻿using System;
using System.Composition;

namespace GaleSong
{
    public interface IPartMetaData
    {
        string PartName { get; }
        string BasePart { get; }
        string PreviousPart { get; }
        string NextPart { get; }
    }

    public interface IMenuPartMetaData
    {
        string MenuName { get; }
        string BaseMenu { get; }
        string PreviousMenu { get; }
        string NextMenu { get; }
    }

    public interface IToolBarPartMetaData
    {
        string ToolBarName { get; }
        string BaseToolBar { get; }
        string PreviousToolBar { get; }
        string NextToolBar { get; }
    }

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class PartAttribute : ExportAttribute, IPartMetaData
    {
        public PartAttribute() : base(typeof(IPart))
        {
        }

        public PartAttribute(Type contractType) : base(contractType)
        {
        }

        #region IMenuPartMetaData Members

        public string PartName { get; set; }

        public string BasePart { get; set; }

        public string PreviousPart { get; set; }

        public string NextPart { get; set; }

        #endregion
    }

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class MenuPartAttribute : ExportAttribute, IMenuPartMetaData
    {
        public MenuPartAttribute() : base(typeof(IMenuPart))
        {
        }

        public MenuPartAttribute(Type contractType) : base(contractType)
        {
        }

        #region IMenuPartMetaData Members

        public string MenuName { get; set; }

        public string BaseMenu { get; set; }

        public string PreviousMenu { get; set; }

        public string NextMenu { get; set; }

        #endregion
    }

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ToolBarPartAttribute : ExportAttribute, IToolBarPartMetaData
    {
        public ToolBarPartAttribute() : base(typeof(IToolBarPart))
        {
        }

        public ToolBarPartAttribute(Type contractType) : base(contractType)
        {
        }

        #region IToolBarPartMetaData Members

        public string ToolBarName { get; set; }

        public string BaseToolBar { get; set; }

        public string PreviousToolBar { get; set; }

        public string NextToolBar { get; set; }

        #endregion
    }
}